<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>
<html lang="en">
<head>
    <title><?php echo $this->config->item('system_name');?></title><meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="<?php echo $this->config->item('system_public_path');?>css/bootstrap.min.css" />
    <link rel="stylesheet" href="<?php echo $this->config->item('system_public_path');?>css/bootstrap-responsive.min.css" />
    <link rel="stylesheet" href="<?php echo $this->config->item('system_public_path');?>css/matrix-login.css" />
    <link rel="stylesheet" href="<?php echo $this->config->item('system_public_path');?>css/jquery.gritter.css" />
    <link rel="stylesheet" href="<?php echo $this->config->item('system_public_path');?>font-awesome/css/font-awesome.css" />
</head>
<body>
    <div id="loginbox">           
        <?php
        $attributes = array('id' => 'loginform', 'class' => 'form-vertical');
        echo form_open($this->config->item('system_manage_path').'login', $attributes);
        ?>
        <div class="control-group normal_text"> <h3><img src="<?php echo $this->config->item('system_public_path');?>img/logo.png" alt="Logo" /></h3></div>
            <div class="control-group">
                <div class="controls">
                    <div class="main_input_box">
                        <span class="add-on bg_lg"><i class="icon-user"></i></span><input type="text" name="username" id="username" value="<?php echo set_value('username'); ?>" placeholder="UserName" /> 
                    </div>
                </div>
            </div>
            <div class="control-group">
                <div class="controls">
                    <div class="main_input_box">
                        <span class="add-on bg_ly"><i class="icon-lock"></i></span><input type="password" name="password" id="password" value="<?php echo set_value('password'); ?>" placeholder="PassWord" /> 
                    </div>
                </div>
            </div>
            <div class="control-group">
                <div class="controls">
                    <div class="main_input_box">
                        <span class="add-on bg_ls"><i class="icon-check"></i></span><input type="text" name="checkcode" id="checkcode" value="<?php echo set_value('checkcode'); ?>" placeholder="checkCode" style="width:52%" /><span style="width: 90px"><a href="javascript:void(0);" id="reload-captcha"><span id="captcha-image"></span></a>&nbsp;</span> 
                    </div>
                </div>
            </div>
            <div class="form-actions">
                <span class="pull-left"></span>
              <span class="pull-right"><input type="submit" value="登录" class="btn btn-success"><input name="action" type="hidden" value="login"></span>
            </div>
        </form>
    </div>
    
    <script src="<?php echo $this->config->item('system_public_path');?>js/jquery.min.js"></script>  
    <script src="<?php echo $this->config->item('system_public_path');?>js/matrix.login.js"></script>
    <script src="<?php echo $this->config->item('system_public_path');?>js/jquery.gritter.min.js"></script> 
    <script type="text/javascript">
    function get_captcha() {
        $.get("<?php echo site_url($this->config->item('system_manage_path').'captcha');?>", function(data){
            $('#captcha-image').html(data);
        });
    };
    $(function(){
        get_captcha();
        $('#reload-captcha').click(get_captcha);
        <?php 
        $error=validation_errors();
        if(strlen($error)>0){
        ?>
        $.gritter.add({
			title:	'登录提示',
			text:	'<?php echo form_error('username'); ?>\n<?php echo form_error('password'); ?>\n<?php echo form_error('checkcode'); ?>',
			sticky: false
		});	
		<?php }?>
    })
    </script>
</body>

</html>
